package com.beidouapp.dao.impl;

import java.util.List;
import java.util.Map;

import com.beidouapp.domain.pojo.Organization;
import com.beidouapp.domain.pojo.Role;
import com.beidouapp.mapper.BaseMapper;
import com.beidouapp.mapper.OrganizationMapper;
import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.beidouapp.domain.pojo.OrganizationExtend;
import com.beidouapp.dao.OrganizationDao;

@Repository
public class OrganizationDaoImpl extends BaseDaoImpl<Organization> implements OrganizationDao {

    @Autowired
    private OrganizationMapper mapper;

    @Override
    public BaseMapper<Organization> getResourceMapper() {
        return this.mapper;
    }

    @Override
    public List<Organization> findAllChildOrgWithPageByMap(Map<String, Object> params, Integer offset, Integer limit) {
        return mapper.findEntryListByMap(new RowBounds(offset, limit), params);
    }

    @Override
    public long findAllChildOrgCountWithPageByMap(Map<String, Object> params) {
        return mapper.findEntryCountByMap(params);
    }

    @Override
    public Integer removeOrganizationBatch(Map<String, Object> params){
        return mapper.removeEntryBatch(params);
    }
}
